import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:tiktokadult/assets_tool/images.dart';
import 'package:tiktokadult/hj_page/home_business/search_page/search_main_logic.dart';
import 'package:tiktokadult/hj_page/home_business/search_page/search_main_page.dart';
import 'package:tiktokadult/hj_utils/widget_utils.dart';
import 'package:tiktokadult/routers/jump_router.dart';

import '../../home_main_logic.dart';

class CommonSearchBarView extends StatelessWidget {
  final bool isDarkStyle;
  final HomeMainLogic? logic;

  const CommonSearchBarView({
    super.key,
    this.isDarkStyle = false,
    this.logic,
  });

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        16.sizeBoxW,
        Expanded(
          child: InkWell(
            onTap: () => Get.to(SearchMainPage()),
            child: Container(
              height: 32,
              padding: EdgeInsets.only(left: 12),
              alignment: Alignment.centerLeft,
              decoration: BoxDecoration(
                color: Color(0x1AFFFFFF),
                borderRadius: BorderRadius.circular(3),
              ),
              child: Row(
                mainAxisSize: MainAxisSize.min,
                children: [
                  Image.asset("search_icon.webp".homePath, width: 16),
                  12.sizeBoxW,
                  Text(
                    "输入搜索关键词",
                    style: TextStyle(
                      color: Color(0x4DFFFFFF),
                      fontSize: 14,
                    ),
                  ),
                ],
              ),
            ),
          ),
        ),
        12.sizeBoxW,
        InkWell(
          onTap: () => jumpToWalletPage(),
          child: Image.asset("vip_home.webp".homePath, height: 32),
        ),
        16.sizeBoxW,
      ],
    );
  }
}
